package control;

import java.util.Calendar;
import java.util.GregorianCalendar;
import java.sql.Timestamp;


public class customTimestamp {
	
	public static Timestamp makeTimestamp(int year, int month, int day, int hour, int minute,
		      int second, int millisecond) {
		    Calendar cal = new GregorianCalendar();
		    cal.set(Calendar.YEAR, year);
		    cal.set(Calendar.MONTH, month - 1);
		    cal.set(Calendar.DATE, day);
		    cal.set(Calendar.HOUR_OF_DAY, hour);
		    cal.set(Calendar.MINUTE, minute);
		    cal.set(Calendar.SECOND, second);
		    cal.set(Calendar.MILLISECOND, millisecond);

		    // now convert GregorianCalendar object to Timestamp object
		    return new Timestamp(cal.getTimeInMillis());
		  }
}
